package com.david.xlib.widget.recyclerview;

import android.content.Context;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;

import com.david.xlib.R;
import com.david.xlib.widget.bgarefresh.BGARefreshLayout;

/**
 * Created by david on 17/9/6.
 */

public class XRecyclerView extends FrameLayout {
    protected RecyclerView recyclerView;
    protected BGARefreshLayout bgaRefreshLayout;

    public XRecyclerView(@NonNull Context context) {
        super(context);
        init();
    }

    public XRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public XRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.view_xrecyclerview, this, true);

        bgaRefreshLayout = (BGARefreshLayout) findViewById(R.id.bgarefresh_xrecycler);
        recyclerView = (RecyclerView) findViewById(R.id.recycler_xrecycler);
    }
}
